home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 March / pcp161b.iso / handson / archive / Issue159 / files / copyjava.exe / compiling the examples.txt
Encoding:
Text File  |  1999-10-03  |  2.2 KB  |  70 lines

  1. These are descriptions of how to compile and run the Java .java files using the 
  2. Sun JDK, JBuilder/JDeveloper and Java Cafe IDEs. Other IDEs should be very similar.
  3.  
  4. Sun Java Development Kit (JDK)
  5. ------------------------------
  6.  
  7. 1. Create a special folder (e.g. C:\GIF) on your hard disk and then copy all 
  8.    of the workshop files and subfolders into it. The Java Development Kit should 
  9.    be installed on your PC and both the current directory and the standard classes 
  10.    library should be included in a CLASSPATH variable. You can check this by opening 
  11.    a DOS window and typing:
  12.  
  13.     C:\GIF>set
  14.  
  15.    The result should look something like this:
  16.  
  17.     .
  18.     .
  19.     PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.1.5\BIN
  20.     CLASSPATH=.;C:\jdk1.1.5\lib
  21.     .
  22.     .
  23.  
  24. 2. To recompile the first example (Example1.java in the ex1 directory) then type:
  25.  
  26.     C:\GIF>cd ex1
  27.     C:\GIF\ex1>build
  28.  
  29.    This should recompile the library files into the ex1 directory, then recompile the 
  30.    Example1.java source.
  31.  
  32. 3. You can re-compile the other example in the same way.
  33.  
  34.  
  35. Oracle JDeveloper/Inprise(Borland) JBuilder
  36. -------------------------------------------
  37.  
  38. 1. Create a new empty project on your hard drive. Copy into it all example source code file
  39.    (e.g. Example1.java in ex1) and *all* the .java files in the "lib" directory.
  40.  
  41. 2. Open the one of the .java files in a text editor and copy the contents to the
  42.    clipboard.
  43.  
  44. 3. Choose "File/New" from the menu and create a new class with an appropriate name (e.g.
  45.    if you have just copied the contents of the GIFImage.java file, then call the new class
  46.    "GIFImage") and without a package name
  47.  
  48. 4. Replace all of the code in the .java file that is created with the code you
  49.    have on the clipboard.
  50.  
  51. 5. Repeat these two steps for all of the other .java files.
  52.  
  53. 6. Build all files and run the project.
  54.  
  55.  
  56.  
  57. Java Cafe
  58. ---------
  59.  
  60. 1. Create a folder called c:\GIF on your hard disk and start Cafe PDE
  61.  
  62. 2. Create a new empty project
  63.  
  64. 3. Save the project to your new folder (c:\GIF)
  65.  
  66. 4. Choose "Insert/Files into project..." from the menu and insert the 
  67.    all the .java files from the "lib" directory into the project
  68.  
  69. 6. Build all files and run the project
  70.